﻿using System.Windows.Forms;

namespace HRN.Bot {
    public partial class ProcessHistory : Form {
        public ProcessHistory() {
            InitializeComponent();
        }

        //public UrlHistory[] _urlHistory;
        //public UrlHistory[] InfoEntity {
        //    get {
        //        return _urlHistory;
        //    }
        //    set {
        //        _urlHistory = value;
        //    }
        //}

        private void ProcessHistory_Load(object sender, System.EventArgs e) {
            bindingSourceURL.DataSource =MainMenu.DefaultInstance.urlhistory;
            if (bindingSourceURL.Current != null)
                bindingSourceProxy.DataSource = (bindingSourceURL.Current as UrlHistory).Proxies;
        }

        private void dataGridView1_MouseClick(object sender, MouseEventArgs e) {
            if (bindingSourceURL.Current!=null)
                bindingSourceProxy.DataSource = (bindingSourceURL.Current as UrlHistory).Proxies;
        }

        private void refreshToolStripMenuItem_Click(object sender, System.EventArgs e) {
            ProcessHistory_Load(null, null);
            dataGridView1.Refresh();
            dataGridView2.Refresh();
        }

        private void dataGridView1_KeyDown(object sender, KeyEventArgs e) {
            if (bindingSourceURL.Current != null)
                bindingSourceProxy.DataSource = (bindingSourceURL.Current as UrlHistory).Proxies;

        }

        private void dataGridView1_KeyUp(object sender, KeyEventArgs e) {
            if (bindingSourceURL.Current != null)
                bindingSourceProxy.DataSource = (bindingSourceURL.Current as UrlHistory).Proxies;
        }

    }
}
